import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { equipmentTypeModelVO, equipmentTypeModelForm, equipmentTypeModelQuery } from '@/api/facility/equipment-type-model/types';

/**
 * 查询设备类型-模型列表
 * @param query
 * @returns {*}
 */

export const listequipmentTypeModel = (query?: equipmentTypeModelQuery): AxiosPromise<equipmentTypeModelVO[]> => {
  return request({
    url: '/equipment/equipment-type-model/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询设备类型-模型详细
 * @param equipmentTypeModelId
 */
export const getequipmentTypeModel = (equipmentTypeModelId: string | number): AxiosPromise<equipmentTypeModelVO> => {
  return request({
    url: '/equipment/equipment-type-model/' + equipmentTypeModelId,
    method: 'get'
  });
};

/**
 * 新增设备类型-模型
 * @param data
 */
export const addequipmentTypeModel = (data: equipmentTypeModelForm) => {
  return request({
    url: '/equipment/equipment-type-model',
    method: 'post',
    data: data
  });
};

/**
 * 修改设备类型-模型
 * @param data
 */
export const updateequipmentTypeModel = (data: equipmentTypeModelForm) => {
  return request({
    url: '/equipment/equipment-type-model',
    method: 'put',
    data: data
  });
};

/**
 * 删除设备类型-模型
 * @param equipmentTypeModelId
 */
export const delequipmentTypeModel = (equipmentTypeModelId: string | number | Array<string | number>) => {
  return request({
    url: '/equipment/equipment-type-model/' + equipmentTypeModelId,
    method: 'delete'
  });
};
